package by.home.controller;

import java.util.HashMap;

public abstract class ClassFinder {

    private HashMap<String, Class> actionsClasses;

    public abstract HashMap<String, Class> createActions();

    public HashMap<String, Class> initActions() {
        return createActions();
    }

    public Class getActionClass(String requestPage){

        actionsClasses = initActions();

        for(String reqPage: actionsClasses.keySet()){
            if (reqPage.equals(requestPage)){
                return actionsClasses.get(reqPage);
            }
        }

        return null;
    }
}
